<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
 
<xsl:output method="html" indent="yes" encoding="UTF-8" />

<xsl:variable name="linkbeginn" select="'http://partners.webmasterplan.com/click.asp?ref=261205&amp;site=2988&amp;type=text&amp;tnb=15&amp;diurl=http://banner.nonstoppartner.de/common/banner.php?i=click&amp;client=douglas&amp;camp=deep&amp;nw=3iel&amp;deepid='"/>
<xsl:variable name="linkende" select="''"/>
<!--
http://partners.webmasterplan.com/click.asp?ref=261205&site=2988&type=text&tnb=15&diurl=http://banner.nonstoppartner.de/common/banner.php?i=click&client=douglas&camp=deep&nw=3iel&deepid=371642
-->
<xsl:template match="/">
<html>
	<head>
	<link rel="stylesheet" href="css/style.css" type="text/css"></link>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
	</head>
	<body>
	<table class="yves" cellspacing="0">
		<xsl:variable name="tr" select="//table[@cellspacing='0' and @cellpadding='0' and @border='0' and not(contains(tr/td/span[@class='small']/a[@class='small']/img[@width!='1']/@src,'default.gif'))]"/>
		<xsl:apply-templates select="$tr"/>
	</table>
	</body>
	</html>	
</xsl:template>

<xsl:template match="table">
<!--	<xsl:variable name="link" select="tr/td/span[@class='small']/a[@class='small']/@href" /> -->
	<xsl:variable name="link"><xsl:call-template name="pid1"><xsl:with-param name="value" select="tr/td/span[@class='small']/a[@class='small']/img[@width!='1']/@src"/></xsl:call-template></xsl:variable>
	<tr>
		<td>
			<a target="_top" href="{concat($linkbeginn, substring-before($link, '.'))}"><xsl:apply-templates select="tr/td/span[@class='small']/a[@class='small']/img[@width!='1']"/></a>
		</td>
		<td>
			<div>
			<xsl:apply-templates select="tr/td/span[@class='small']/a[@class='small']/text()"/>
			</div>
			<div>
			<xsl:apply-templates select="tr/td/font"/>
			</div>
		</td>
	</tr>
</xsl:template>

<xsl:template match="font">
	<xsl:choose>
		<xsl:when test="b"><b class="bold"><xsl:value-of select="b"/></b></xsl:when>
		<xsl:otherwise><b class="remarque"><xsl:value-of select="."/></b></xsl:otherwise>
	</xsl:choose>
	<xsl:text> </xsl:text>
</xsl:template>

<xsl:template name="pid1">
	<xsl:param name="value"/>
	<xsl:choose>
		<xsl:when test="contains($value, '/')">
			<xsl:variable name="v"><xsl:value-of select="substring-after($value,'/')" /></xsl:variable>
			<xsl:call-template name="pid1"><xsl:with-param name="value" select="$v" /></xsl:call-template>
		</xsl:when>
		<xsl:otherwise><xsl:value-of select="$value" /></xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template match="text()">
	<xsl:variable name="text" select="normalize-space()"/>
	<xsl:if test="$text!=''">
		<xsl:value-of select="$text"/><br/>
	</xsl:if>
</xsl:template>

<xsl:template match="img">
	<img src="{@src}" alt="{@alt}"></img>
</xsl:template>

<!--
<xsl:template match="@*|node()" >
	<xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
</xsl:template>
-->
</xsl:stylesheet>